import request from '@/utils/request'

const admin = {
  admin: {
    index: (params) => request({ url: '/?method=admin.admin.index', method: 'get', params: params }),
    detail: (params) => request({ url: '/?method=admin.admin.detail', method: 'get', params: params }),
    add: (params) => request({ url: '/?method=admin.admin.add', method: 'post', params: params }),
    edit: (params) => request({ url: '/?method=admin.admin.edit', method: 'post', params: params }),
    del: (params) => request({ url: '/?method=admin.admin.del', method: 'post', params: params }),
    multi: (params) => request({ url: '/?method=admin.admin.multi', method: 'post', params: params })
  },
  role: {
    index: (params) => request({ url: '/?method=admin.role.index', method: 'get', params: params }),
    detail: (params) => request({ url: '/?method=admin.role.detail', method: 'get', params: params }),
    add: (params) => request({ url: '/?method=admin.role.add', method: 'post', params: params }),
    edit: (params) => request({ url: '/?method=admin.role.edit', method: 'post', params: params }),
    del: (params) => request({ url: '/?method=admin.role.del', method: 'post', params: params }),
    multi: (params) => request({ url: '/?method=admin.role.multi', method: 'post', params: params }),
    resource: (params) => request({ url: '/?method=admin.role.resource', method: 'get', params: params })
  },
  resource: {
    index: (params) => request({ url: '/?method=admin.resource.index', method: 'get', params: params }),
    detail: (params) => request({ url: '/?method=admin.resource.detail', method: 'get', params: params }),
    add: (params) => request({ url: '/?method=admin.resource.add', method: 'post', params: params }),
    edit: (params) => request({ url: '/?method=admin.resource.edit', method: 'post', params: params }),
    del: (params) => request({ url: '/?method=admin.resource.del', method: 'post', params: params }),
    multi: (params) => request({ url: '/?method=admin.resource.multi', method: 'post', params: params })
  },
  log: {
    index: (params) => request({ url: '/?method=admin.log.index', method: 'get', params: params }),
    detail: (params) => request({ url: '/?method=admin.log.detail', method: 'get', params: params })
  }
}

export default admin
